package myservice.android.utilities;

import myservice.android.R;
import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.Button;
import android.widget.LinearLayout;

public class CalendarView extends LinearLayout {
	
	public Button[][] calendarDays = new Button[6][7];

	public CalendarView(Context context, AttributeSet attrs) {
		super(context, attrs);
		LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.calendarmonth, this, true);
		
		setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
		
        calendarDays[0][0] = (Button) findViewById(R.id.button0_0);
        calendarDays[0][1] = (Button) findViewById(R.id.button0_1);
        calendarDays[0][2] = (Button) findViewById(R.id.button0_2);
        calendarDays[0][3] = (Button) findViewById(R.id.button0_3);
        calendarDays[0][4] = (Button) findViewById(R.id.button0_4);
        calendarDays[0][5] = (Button) findViewById(R.id.button0_5);        
        calendarDays[0][6] = (Button) findViewById(R.id.button0_6);                
        calendarDays[1][0] = (Button) findViewById(R.id.button1_0);
        calendarDays[1][1] = (Button) findViewById(R.id.button1_1);
        calendarDays[1][2] = (Button) findViewById(R.id.button1_2);
        calendarDays[1][3] = (Button) findViewById(R.id.button1_3);
        calendarDays[1][4] = (Button) findViewById(R.id.button1_4);
        calendarDays[1][5] = (Button) findViewById(R.id.button1_5);        
        calendarDays[1][6] = (Button) findViewById(R.id.button1_6);              
        calendarDays[2][0] = (Button) findViewById(R.id.button2_0);
        calendarDays[2][1] = (Button) findViewById(R.id.button2_1);
        calendarDays[2][2] = (Button) findViewById(R.id.button2_2);
        calendarDays[2][3] = (Button) findViewById(R.id.button2_3);
        calendarDays[2][4] = (Button) findViewById(R.id.button2_4);
        calendarDays[2][5] = (Button) findViewById(R.id.button2_5);        
        calendarDays[2][6] = (Button) findViewById(R.id.button2_6);           
        calendarDays[3][0] = (Button) findViewById(R.id.button3_0);
        calendarDays[3][1] = (Button) findViewById(R.id.button3_1);
        calendarDays[3][2] = (Button) findViewById(R.id.button3_2);
        calendarDays[3][3] = (Button) findViewById(R.id.button3_3);
        calendarDays[3][4] = (Button) findViewById(R.id.button3_4);
        calendarDays[3][5] = (Button) findViewById(R.id.button3_5);        
        calendarDays[3][6] = (Button) findViewById(R.id.button3_6);        
        calendarDays[4][0] = (Button) findViewById(R.id.button4_0);
        calendarDays[4][1] = (Button) findViewById(R.id.button4_1);
        calendarDays[4][2] = (Button) findViewById(R.id.button4_2);
        calendarDays[4][3] = (Button) findViewById(R.id.button4_3);
        calendarDays[4][4] = (Button) findViewById(R.id.button4_4);
        calendarDays[4][5] = (Button) findViewById(R.id.button4_5);        
        calendarDays[4][6] = (Button) findViewById(R.id.button4_6);        
        calendarDays[5][0] = (Button) findViewById(R.id.button5_0);
        calendarDays[5][1] = (Button) findViewById(R.id.button5_1);
        calendarDays[5][2] = (Button) findViewById(R.id.button5_2);
        calendarDays[5][3] = (Button) findViewById(R.id.button5_3);
        calendarDays[5][4] = (Button) findViewById(R.id.button5_4);
        calendarDays[5][5] = (Button) findViewById(R.id.button5_5);        
        calendarDays[5][6] = (Button) findViewById(R.id.button5_6);
		
	}
	
	public CalendarView(Context context) {
		this(context, null);
	}

}
